<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	protected function _initAutoloader()
	{
		require_once 'Zend/Loader/Autoloader.php';
		$loader = Zend_Loader_Autoloader::getInstance();
		$loader->registerNamespace('Nippy_');
	}

	
	protected function _initDbAdapter()
	{
		$r = $this->getPluginResource('db');
		$p = $r->getParams();
		if (isset($p['prefix']))
			Zend_Registry::set('TABLE_PREFIX', $p['prefix']);
		$dbAdapter = $r->getDbAdapter();
        if (isset($p['setCharset']) && $p['setCharset'])
            $dbAdapter->query("set character_set_client='utf8'; set character_set_results='utf8'; set collation_connection='utf8_general_ci';");
		return $dbAdapter;
	}
}